package com.kitty.game.gm.handler100;

import com.kitty.common.utils.SpringUtils;
import com.kitty.game.equip.message.RespNotifyMiscEx;
import com.kitty.game.pay.model.PayNotifyInfo;
import com.kitty.game.pay.service.OrderService;
import com.kitty.game.role.model.Role;
import com.kitty.mina.message.MessagePusher;
import org.nutz.lang.random.R;

import java.util.Date;

public class NCChongzhi implements NCGmFather {
    @Override
    public void handle(Role role, String content) {
        //String[] strings = content.split("##");
        PayNotifyInfo payNotifyInfo = new PayNotifyInfo();
        payNotifyInfo.setMoney(Integer.parseInt(content));
        payNotifyInfo.setTradeNo("MY-"+ R.UU32());
        payNotifyInfo.setAccount(role.getSid());
        payNotifyInfo.setRoleUid(role.getUid());
      //  payNotifyInfo.setGold(Integer.parseInt(strings[1]));
        payNotifyInfo.setCreateTime(new Date());
        SpringUtils.getBean(OrderService.class).handleOrder(payNotifyInfo);
        MessagePusher.pushMessage(role,new RespNotifyMiscEx("充值成功！！"));
    }
}
